package javaStudy.io流;

import java.io.*;

public class 字符流 {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter ows=new OutputStreamWriter(new FileOutputStream("ows.txt"));
        ows.write("中国");
        ows.close();
        InputStreamReader isr=new InputStreamReader(new FileInputStream("ows.txt"));
//        int by;
//        while((by=isr.read())!=-1){
//            System.out.println((char) by);
//        }
        char[] ch=new char[1024];
        int len;
        while((len=isr.read(ch))!=-1){
            System.out.println(new String(ch,0,len));
        }
        isr.close();
    }
}
